package com.crr.controller;

import com.crr.ret.ResultData;
import com.crr.service.AccountService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class AccountController {
    @Resource
    private AccountService accountService;

    @PostMapping("account/decrease")
    public ResultData decrease(Long userId, Long money) {
        accountService.decrease(userId, money);
        return ResultData.success("扣减账户余额成功");
    }
}
